
//
//  HTPaymentSendCodeLabel.m
//  HTPaymentFramework
//
//  Created by 内蒙小猿 on 2018/4/12.
//  Copyright © 2018年 zhaozhongpeng. All rights reserved.
//

#import "HTPaymentSendCodeLabel.h"
#import "PayHeaderFile.h"
@implementation HTPaymentSendCodeLabel

- (instancetype)init{
    self = [super init];
    if (self) {
        [self createUI];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createUI];
    }
    return self;
}


- (void)createUI{
    self.font = [UIFont systemFontOfSize:HTPaymentRealWidth(30)];
    self.textAlignment = NSTextAlignmentCenter;
    self.userInteractionEnabled = NO;
    self.translatesAutoresizingMaskIntoConstraints = NO;
    UIView *line = [[UIView alloc] init];
    line.translatesAutoresizingMaskIntoConstraints = NO;
    line.backgroundColor = [UIColor lightGrayColor];
    [self addSubview:line];
    
    
    NSLayoutConstraint *lineFieldTop = [NSLayoutConstraint constraintWithItem:line attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-1];
    
    NSLayoutConstraint *lineFieldLeft = [NSLayoutConstraint constraintWithItem:line attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
    
    NSLayoutConstraint *lineFieldRight = [NSLayoutConstraint constraintWithItem:line attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
    
    NSLayoutConstraint *lineFieldHeight = [NSLayoutConstraint constraintWithItem:line attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:1];
    [self addConstraints:@[lineFieldTop,lineFieldLeft,lineFieldRight,lineFieldHeight]];
}

@end
